;[USAGE]
;generate a TAGS file.
; $find . -name "*.[chCH]" -print | etags -
;[SEE]
; sevaral tool to creat tags:http://www.emacswiki.org/emacs/BuildTags
;(1) Lisp:traverselisp.el is able to build tags fast recursively in a directory tree with 
;    ` M-x traverse-build-tags-in-project’ then just choose extension from prompt.
;(2) etags-update.el is a global minor mode that will update your TAGS when you save a file. 
;    It can also offer to add a file to your TAGS if it is not already indexed.

;manually create a TAGS file in a dir.
(defun create-tags (dir-name)
  "Create tags file."
  (interactive "DDirectory: ")
  (eshell-command 
   (format "find %s -type f -name \"*.[ch]*\" | etags -a  --declarations -" dir-name)))
(defun create-tags-java (dir-name)
  "Create tags file."
  (interactive "DDirectory: ")
  (eshell-command 
   (format "find %s -type f -name \"*.java*\" | etags -a  --declarations -" dir-name)))


